package com.hf.eagle.web.struts;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.hf.eagle.domain.Accessory;
import com.hf.eagle.domain.NewsInfo;
import com.hf.eagle.domain.ProductInfo;
import com.hf.eagle.domain.SaleGrid;
import com.hf.eagle.domain.SiteLink;
import com.hf.eagle.web.base.BaseAction;
import com.hf.eagle.web.base.Pager;
import com.hf.eagle.web.base.SysConstant;

public class SiteLinkAction extends BaseAction {

	public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		return this.view(mapping, form, request, response);
	}

	public ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		SiteLink siteLink = new SiteLink();
		siteLink.setIs_del(0);
		siteLink.setMod_id((long) 4200);
		List<SiteLink> siteLinks = getFacade().getSiteLinkService().getSiteLinkList(siteLink);
		StringBuffer sf = new StringBuffer();
		for (SiteLink siteLink2 : siteLinks) {
			sf.append("| <a href=\""+siteLink2.getSite_url()+"\" target=\"_blank\">"+siteLink2.getSite_name()+"</a>");
		}
		super.renderText(response, sf.toString());
		return null;
	}
}